#include <include/edge.hpp>
#include <include/graph.hpp>

typedef std::vector<Edge*>::iterator iter_vec_edge;

Graph::Graph(){
    this->listOfEdges = new std::vector<Edge*>();
    this->listOfVertices = new std::vector<Vertex*>();
}

Graph::~Graph() {
    iter_vec_edge iter_edge_end = this->listOfEdges->end();

    for(iter_vec_edge iter_edge = this->listOfEdges->begin(); iter_edge != iter_edge_end; ++iter_edge) {
        delete (*iter_edge);
    }

    delete this->listOfEdges;
}

int Graph::getNumberOfVertices() {
    return this->numberOfVertices;
}

std::vector<Edge*> * Graph::getListOfEdges(){
    return this->listOfEdges;
}

std::vector<Vertex*> * Graph::getListOfVertices() {
    return this->listOfVertices;
}

void Graph::addEdge(Edge *actualEdge){
    this->listOfEdges->push_back(actualEdge);
}

void Graph::addVertex(Vertex * vertex) {
    this->listOfVertices->push_back(vertex);
}

void Graph::setNumberOfVertices(int number) {
    this->numberOfVertices = number;
}

int Graph::getGraphsDiameter() {
    return graphsDiameter;
}
    
void Graph::setGraphsDiameter(int diameter) {
    graphsDiameter = diameter;
}
    
int Graph::getLowerBound() {
    return lowerBound;
}
    
int Graph::setLowerBound(int bound) {
    lowerBound = bound;
}
